package com.yituo.mjworld.mvc.entity.web;

import com.yituo.mjworld.core.annotation.Rules;
import com.yituo.mjworld.core.web.core.BaseForm;

import javax.persistence.*;

@Entity
@Table(name = "web_search_conf", schema = "web_mojianworld_server", catalog = "")
public class WebSearchConf extends BaseForm {
  @Rules(id = true, fieldName = "主键")
  public int id;
  @Rules(fieldName = "标题")
  public String title;
  // TODO:名称待修改
  @Rules(fieldName = "快捷搜索对应的商品")
  public String url;
  @Rules(fieldName = "序列号", required = false)
  public int orderNum;
  @Rules(fieldName = "点击次数", required = false)
  public int clickCount;

  @Id
  @Column(name = "id", nullable = false)
  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  @Basic
  @Column(name = "title", nullable = false, length = 50)
  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  @Basic
  @Column(name = "url", nullable = false, length = 50)
  public String getUrl() {
    return url;
  }

  public void setUrl(String url) {
    this.url = url;
  }

  @Basic
  @Column(name = "orderNum", nullable = false)
  public int getOrderNum() {
    return orderNum;
  }

  public void setOrderNum(int orderNum) {
    this.orderNum = orderNum;
  }

  @Basic
  @Column(name = "clickCount", nullable = false)
  public int getClickCount() {
    return clickCount;
  }

  public void setClickCount(int clickCount) {
    this.clickCount = clickCount;
  }


  @Override
  public int hashCode() {
    int result = id;
    result = 31 * result + (title != null ? title.hashCode() : 0);
    result = 31 * result + (url != null ? url.hashCode() : 0);
    result = 31 * result + orderNum;
    result = 31 * result + clickCount;
    return result;
  }

  @Override
  public boolean validate() {
    return defaultValidate();
  }
}
